package wechat.service;

import com.alibaba.fastjson.JSONObject;

import wechat.resources.InstanceResource;


public interface MessageService {
	/**
	 * 发送文本消息
	 * 
	 *  数据格式：
	 *  
	 *  	{                                       
	 *		   "touser": "UserID1|UserID2|UserID3",
	 *		   "toparty": " PartyID1 | PartyID2 ", 
	 *		   "totag": " TagID1 | TagID2 ",       
	 *		   "agentid": 1,                       
	 *		   "text": "test",                     
	 *		   "safe":0                            
	 *		}   
	 * 
	 * 
	 * 
	 * 
	 * @param instanceResource
	 * @param jsonParam
	 * @return
	 * @throws Exception
	 */
	public String sendText(InstanceResource instanceResource,JSONObject jsonParam) throws Exception;
	/**
	 * 发送图文消息
	 * 
	 * 数据格式：
	 * 
	 * 		{
	 *			   "touser": "UserID1|UserID2|UserID3",
	 *			   "toparty": " PartyID1 | PartyID2 ",
	 *			   "totag": " TagID1 | TagID2 ",
	 *			   "agentid": 1,
	 *			   "articles":[
	 *			           {
	 *			               "title": "Title",
	 *			               "description": "Description",
	 *			               "url": "URL",
	 *			               "picurl": "PIC_URL"
	 *			           },
	 *			           {
	 *			               "title": "Title",
	 *			               "description": "Description",
	 *			               "url": "URL",
	 *			               "picurl": "PIC_URL"
	 *			           }    
	 *			       ]
	 *			}
	 * 
	 * 
	 * @param instanceResource
	 * @param jsonParam
	 * @return
	 * @throws Exception
	 */
	public String sendNews(InstanceResource instanceResource,JSONObject jsonParam) throws Exception;

}
